
package com.rx.mgt.dao;  

import com.rx.mgt.domain.Domain;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.rx.mgt.dao.base.ManagementHibernateDaoBase;
import com.rx.mgt.domain.EmailUser;

/** 
 * ClassName:EmailUserDao 
 * Function :
 * Reason   : 
 * Date     :Jan 31, 2017 9:20:47 PM 
 * @author   luolei 
 * @since    JDK 1.6
 */
@Repository
public class EmailUserDao  extends ManagementHibernateDaoBase<EmailUser, String>{

    public EmailUser selectUserByUserName(String username) {
        String hql= "from EmailUser  dd where 1=1 and  dd.user_name=:username";
        Query query = template.getSessionFactory().getCurrentSession().createQuery(hql);
        query.setParameter("username",username);
        return (EmailUser) query.uniqueResult();
    }
}
  